﻿@*@{
    Layout = null;
    }*@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>青橙酒店</title>
    <link rel="stylesheet" href="/layuimini/lib/layui-v2.6.3/css/layui.css">
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" href="/layuimini/lib/layui-v2.6.3/css/layui.css" tppabs="http://res.layui.com/layui/dist/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuimini/lib/layui-v2.6.3/css/layui.css" media="all">

</head>
<body style="background-color:#e2e2e2;">


    <div>
        <div style="background-color:white;width:600px;height:700px;margin:auto;padding-top:10px;">
            <div>
                <div class="layui-form-item">
                    <label class="layui-form-label required">姓名</label>
                    <div class="layui-input-block">
                        <label id="label1" class="layui-form-label required">未登录</label>
                    </div>
                </div>
            </div>

            <div>
                <div class="layui-form-item">
                    <label class="layui-form-label required">手机号</label>
                    <div class="layui-input-block">
                        <label id="label2" class="layui-form-label required">未登录</label>
                    </div>
                </div>
            </div>

            <div>
                <div class="layui-form-item">
                    <label class="layui-form-label required">身份证号</label>
                    <div class="layui-input-block">
                        <label id="label3" class="layui-form-label required">未登录</label>
                    </div>
                </div>
            </div>

            <div style="padding-top:50px;">
                <div style="width:500px;margin:auto;">
                    <table class="layui-hide" id="test"></table>
                </div>
            </div>
        </div>
    </div>

    <script src="/layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="/layuimini/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
    <script src="/layuimini/lib/jquery-3.4.1/jquery.cookie.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->
    <script>

        function grFunction() {
            window.location.href='/Home/zhuceye';
        }

        layui.use('layer', function(){
            var layer = layui.layer;
            //layer.msg('hello');
        });

        //未登录隐藏数据表格 - 失败
        //$(document).ready(function(){
        //    name = $.cookie('UserName');// 读取 cookie
        //    if(name != ""){
        //        $("test").show();
        //    }
        //    if(name == ""){
        //        $("test").hide();
        //    }
        //});
        layui.use('table', function(){
            var table = layui.table;
            table.render({
                elem: '#test'
                ,url: '/Appointment/GetAppointmentInfo'
                ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
                ,cols: [[
                    {field:'checkInDate',width:130,title: '下单时间'}
                    ,{field:'roomType', width:110, title: '房间类型'}
                    ,{field:'checkDay', width:110, title: '入住天数'}
                    ,{field:'appointmentStatus', title: '预约状态'}
                ]]
            });
        });

        $(document).ready(function(){ 
            name = $.cookie('UserName');// 读取 cookie
            if(name != ""){
                $("#label1").text(name);
            }
            if(name == "undefined"){
                $("#label1").text("未登录");
            }
        });

        $(document).ready(function(){ 
            name = $.cookie('Phone');// 读取 cookie
            if(name != ""){
                $("#label2").text(name);
            }
            if(name == "undefined"){
                $("#label2").text("未登录");
            }
        });

        $(document).ready(function(){ 
            name = $.cookie('ID_Card');// 读取 cookie
            if(name != ""){
                $("#label3").text(name);
            }
            if(name == "undefined"){
                $("#label3").text("未登录");
            }
        });

    </script>
</body>
</html>